<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
    div {
      width: 200px;
      height: 200px;
      border: 10px solid blue;
    }
    .originDiv,.targetDiv {
      background-color: red;
      border-left: 0;
      border-bottom: 0;
    }
    .targetDiv {
      padding-right: 50px;
      background-color: green;
    }
    .targetDiv2,.targetDiv3{
      box-sizing: border-box;
      padding-left: 50px;
      background-color: yellow;
    }
    .targetDiv3 {
      margin-left: 20px;
    }
    </style>
    <link href="css/style.css" rel="stylesheet">
  </head>
  <body>
    <div class="originDiv"><p>作为参考：只有一个右边框 </p></div>
    <div class="targetDiv2"><p>box-sizing: border-box效果:border padding不再撑大盒子 </p></div>
    <div class="targetDiv3"><p>box-sizing: border-box对marfin不影响</p></div>
    <div class="targetDiv"><p>padding也会撑大盒子</p></div>
  
    <p></p>
  </body>
</html>
